package com.zito.health.service.impl;

import com.zito.health.entity.Area;

import com.zito.health.mapper.AreaMapper;

import com.zito.health.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @description:
 * @author: gxt
 * @time: 2019/11/8 14:43
 */
@Service
public class AreaServiceImpl implements AreaService {

    @Autowired
    private AreaMapper areaMapper;

    @Override
    public Area save(Area object) {
        int res = areaMapper.insertSelective(object);
        return object;
    }

    @Override
    public void delete(Integer id) {
        areaMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void update(Area object) {
        areaMapper.updateByPrimaryKeySelective(object);
    }

    @Override
    public List<Area> query() {
        return areaMapper.selectAll();
    }

    @Override
    public List<Area> query(Area object) {
        return areaMapper.select(object);
    }

    @Override
    public Area queryOne(Area object) {
        return areaMapper.selectOne(object);
    }

    @Override
    public Area queryById(Integer id) {
        Area object = areaMapper.selectByPrimaryKey(id);
        return object;
    }

    @Override
    public boolean exists(Integer id) {
        return areaMapper.existsWithPrimaryKey(id);
    }

    @Override
    public List<Area> selectByParam(Map<String, Object> param) {
        return areaMapper.selectAll(param);
    }

}
